import { JSX } from "react";

export enum SelectedPage{
  Home="home",
  Equipment="equipment",
  Venue="venue",
  EventManage="eventManage",
  // 添加用户管理相关页面
  Login="login",
  Register="register",
  UserManagement="userManagement",
  ChangePassword="changePassword",
  PenaltyRules="penaltyRules",
  Announcements="announcements"
}

export interface BenefitType{
  icon:JSX.Element;
  title:string;
  description:string;
}

export interface ClassType{
  name:string;
  description?:string;
  image:string;
}

// 用户相关类型定义
export enum UserRole {
  ADMIN = "admin",
  STUDENT = "student",
  SUPER_ADMIN = "super_admin"
}

export interface User {
  id: string;
  username: string;
  email: string;
  role: UserRole;
  studentId?: string; // 学生专用
  employeeId?: string; // 管理员专用工号
  name: string;
  phone?: string;
  createdAt: Date;
  lastLogin?: Date;
  isActive: boolean;
}

export interface AdminUser extends User {
  role: UserRole.ADMIN | UserRole.SUPER_ADMIN;
  employeeId: string; // 管理员必须有工号
  permissions: string[];
  department?: string;
}

export interface StudentUser extends User {
  role: UserRole.STUDENT;
  studentId: string;
  major?: string;
  grade?: string;
  penaltyPoints: number;
}

// 登录表单 - username字段根据用户类型表示学号或工号
export interface LoginForm {
  username: string; // 学生为学号，管理员为工号
  password: string;
  userType: 'admin' | 'student';
}

// 注册表单
export interface RegisterForm {
  username: string;
  password: string;
  confirmPassword: string;
  email: string;
  name: string;
  studentId: string;
  phone?: string;
  major?: string;
  grade?: string;
}

// 修改密码表单
export interface ChangePasswordForm {
  currentPassword: string;
  newPassword: string;
  confirmPassword: string;
}

// 罚款条例
export interface PenaltyRule {
  id: string;
  title: string;
  description: string;
  penaltyAmount: number;
  penaltyPoints: number;
  category: 'equipment' | 'venue' | 'behavior' | 'other';
  isActive: boolean;
  createdAt: Date;
  updatedAt: Date;
}

// 公告类型
export interface Announcement {
  id: string;
  title: string;
  content: string;
  type: 'notice' | 'maintenance' | 'event' | 'policy' | 'emergency';
  priority: 'low' | 'medium' | 'high' | 'urgent';
  isActive: boolean;
  isPinned: boolean;
  author: string;
  createdAt: string;
  updatedAt: string;
  publishDate: string;
  expireDate?: string;
  attachments?: string[];
}

